function loadRoom(){
	$.ajax({
		url:"../../room/all",
		type:"get",
		dataType:"json",
		success:function(data){
			var content = "";
			var student=null;
			for (var i = 0; i < data.length; i++) {
				room=data[i];
				content +='<tr>'
						+'<td>'+room.roomtype.type+'</td>'
						+'<td>'+room.roomnum+'</td>'
						+'<td>'+room.location+'</td>'
						+'<td>'+room.phone+'</td>'
						+'<td>'+room.cut+'</td>'
						+'<td>'+room.hot+'</td>';
						if(room.status==0){
							content	+='<td>空闲</td>';
						}else if(room.status==1){
							content	+='<td>已住</td>';
						}else if(room.status==2){
							content	+='<td>维修中</td>';
						}else if(room.status==3){
							content	+='<td>已预订</td>';
						}
				content	+='<td>'
						+'<a class="layui-btn layui-btn-xs" onclick="b1('+room.room_id+')">设备设施</a>'
						+'</td>'
						+'<td>'
						+'<a class="layui-btn layui-btn-xs" onclick="delCustomList(this)">删除</a>'
						+'</td>'
						+'</tr>';
				
				
				
			}
			
			$("#room").html(content);
			
			
		}

		
		
		
	});
	
	
	
}
function b1(room_id) {
	layui.use('layer', function() {
		var layer = layui.layer;
		//iframe层-父子操作
		b1s = layer.open({
			title: "父子页面标题",
			type: 2,
			area: ['70%', '60%'],
			scrollbar: true, //默认：true,默认允许浏览器滚动，如果设定scrollbar: false，则屏蔽
			maxmin: true,
			content: 'facilitys.html',
			success: function(layero, index) {
				var iframe = window['layui-layer-iframe' + index];
				iframe.child(room_id)
			}
		});
	});
}


loadRoom();